//
//  AppMarco.h
//  HuaShun
//
//  Created by Fuhao on 16/8/6.
//  Copyright © 2016年 Phenix. All rights reserved.
//
#define CJMOBILE_APP_MARCO

//极光推送key
#define JPUSH_APPKEY @"41bce62952835d644d858be2"
//定义友盟KEY
#define UMENG_APPKEY @"58db2204a40fa372a4001c99"


#if DEBUG
#define DLog(format, ...) printf("\n[%s] %s [第%d行] %s\n", __TIME__, __FUNCTION__, __LINE__, [[NSString stringWithFormat:format, ## __VA_ARGS__] UTF8String]);

#else
# define DLog(...);
#endif

//屏幕的宽度
#define kScreenWidth [UIScreen mainScreen].bounds.size.width

//屏幕的高度
#define kScreenHeight [UIScreen mainScreen].bounds.size.height
//定义字体函数
#define FONT(a)  [UIFont systemFontOfSize:a]
#define BFONT(a)  [UIFont boldSystemFontOfSize:a]
#define SBFONT(a)  [UIFont fontWithName:@"PingFangHK-Medium" size:a]



 #define CLRudeCircleTextFont(a)  [UIFont fontWithName:@"WenYue-XinQingNianTi-NC-W8" size:a]
#define CLNumberTypeTextFont(a)  [UIFont fontWithName:@"Supercell-Magic" size:a]




#define ImageNamed(a) [UIImage imageNamed:a]

//图片资源宏
#define IMAGEURL(a) [NSURL URLWithString:[NSString stringWithFormat:@"%@%@",IMAGEHOST,a]]
//定义颜色函数
#define RGBCOLOR(a,b,c) RGBA(a,b,c,1.0)
#define RGBA(r,g,b,a)   [UIColor colorWithRed:(r)/255.0 green:(g)/255.0 blue:(b)/255.0 alpha:a]
#define UIColorFromRGB(rgbValue) [UIColor colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 green:((float)((rgbValue & 0xFF00) >> 8))/255.0 blue:((float)(rgbValue & 0xFF))/255.0 alpha:1.0]
#define HEXCOLOR(hexValue) [UIColor colorWithRed:((float)((hexValue & 0xFF0000) >> 16)) / 255.0 green:((float)((hexValue & 0xFF00) >> 8)) / 255.0 blue:((float)(hexValue & 0xFF)) / 255.0 alpha:1.0f]
#define HEXCOLOR2(hexValue,a) [UIColor colorWithRed:((float)((hexValue & 0xFF0000) >> 16)) / 255.0 green:((float)((hexValue & 0xFF00) >> 8)) / 255.0 blue:((float)(hexValue & 0xFF)) / 255.0 alpha:a]

//系统标准保存键值
#define UserDefaultStandard  [NSUserDefaults standardUserDefaults]

#define GetViewControllerInStoryboard(storyboardName,identifier) [[UIStoryboard storyboardWithName:storyboardName bundle:nil] instantiateViewControllerWithIdentifier:identifier]


//add by lxj
//随机色
#define XJRandomColor RGBCOLOR(arc4random_uniform(256), arc4random_uniform(256), arc4random_uniform(256))

// 控件尺寸适配的宏函数
#define kFit(x) (kScreenWidth*((x)/375.0))

#define IS_IPHONE_X  ([[UIScreen mainScreen] bounds].size.height == 812 || [[UIScreen mainScreen] bounds].size.height == 896)
#define StatusHeight (int)(IS_IPHONE_X ? 44:20)
#define NavHeight (int)(IS_IPHONE_X ? 88:64)
#define TabbarHeight (int)(IS_IPHONE_X ? 83:49)
#define BottomHeight (int)(IS_IPHONE_X ? 34:0)
///UI配置项
#import "ConfigureUI.h"

//添加商品的相册修改通知
#define XJPhotoBrowserChangeNotification @"XJPhotoBrowserChangeNotification"

//中间按钮点击跳转
#define MTCardNotification1 @"MTCardNotification1"
#define MTCardNotification2 @"MTCardNotification2"
#define MTCardNotification3 @"MTCardNotification3"
#define MTCardNotification4 @"MTCardNotification4"

//中间按钮点击直接跳转
#define MTPhotoNotification1 @"MTPhotoNotification1"
#define MTPhotoNotification2 @"MTPhotoNotification2"
#define MTPhotoNotification3 @"MTPhotoNotification2"
#define MTPhotoNotification4 @"MTPhotoNotification4"

#define MTFabuNotification1 @"MTFabuNotification1"
#define MTMapNotification @"MTMapNotification"
#define MTMessageNotification @"MTMessageNotification"

//登录超时通知
#define TokenTimeoutNotification @"TokenTimeoutNotification"

// 消息通知
#define RegisterNotify(_naardme, _selector) [[NSNotificationCenter defaultCenter] addObserver:self selector:_selector name:_name object:nil];

#define RemoveNotify [[NSNotificationCenter defaultCenter] removeObserver:self];

#define SendNotify(_name, _object) [[NSNotificationCenter defaultCenter] postNotificationName:_name object:_object];

#define SendNotifyWithUseInfo(_name, _object,_useInfo) [[NSNotificationCenter defaultCenter] postNotificationName:_name object:_object useInfo:_useInfo];
